<div class="content">
	<div class="title">
	<h2>答疑系统</h2>
	</div>
	<div class="answersystemblock">
		<div class="studentquery">
		<form action="<?php echo $this->baseUrl().'/answersystem/index';?>" method="post">
		课程名称：<input type="text" id="class" name="class"/>
		学院：<select name="college">
     	 <?php
     	 	foreach ($this->collegearray as $key=>$value)
     	 	{
     	 	    echo '<option value='.$key.'>'.$value.'</option>';
     	 	} 
     	 ?>
     	 </select>
		教师名：<input type="text" id="teachername" name="teachername"/>
		<button type="submit">查看</button>
    	</form>
		</div>
		<div class="indexblock">
		<ul>
		<?php
			foreach($this->allapp as $app)
			{
			    if($app['status']!=1)
			    {
			        echo '<li><a href="'.$this->baseUrl().'/answersystem/studentdetail?id='.$app['id'].'">'.$this->collegearray[$app['college']].$app['teacher'].'老师';
			        if($app['status']==3)echo '【决定';
			        else echo '【准备';
			        echo '】在'.gmdate('Y年m月d日H:i',$app['date']).'答疑-'.$app['class'].'</a></li>';
			    }
			} 
			//<li><a href="">计算机学院zhijian老师【决定】在2012年08月15日09:00答疑-电子技术</a></li>
		?>
			
		</ul>
		<div class="page">
		<a href="<?php echo $this->baseUrl().'/answersystem/index?page='.'1';?>">首页</a>
		<a href="<?php echo $this->baseUrl().'/answersystem/index?page='.($this->page-1);?>">上一页</a>

		<?php
			//echo Zend_Registry::get('config');
			if($this->pagecount<=8)
			{
			    $begin = 1;
			    $end = $this->pagecount;//显示8页
			}
			else 
			{
			    if($this->pagecount-$this->page+1<=8)
			    {
			        $begin = $this->pagecount-7;
			        $end = $this->pagecount;
			    }
			    else 
			    {
			        $begin = $this->page;
			        $end = $this->page + 7;
			    }
			    
			}
			for($i = $begin;$i<=$end;$i++)
			{
			    if($i==$this->page)echo $i;//本页页数没有超链接
			 	else 
			 	{
			 	    echo '<a href="';
			 	    echo $this->baseUrl().'/answersystem/index?page='.$i.'"';
			 	    echo '>'.$i.'</a>';
			 	}
			} 
		?>
		<a href="<?php echo $this->baseUrl().'/answersystem/index?page='.($this->page+1);?>"> 下一页 </a>  
		<a href="<?php echo $this->baseUrl().'/answersystem/index?page='.$this->pagecount;?>">尾页</a>
		</div>
		</div>
	</div>
</div>	